package test3.A1_1;

public class Thoroughbred {
    // 私有属性
    private Thoroughbred mother;     // 母马
    private Thoroughbred father;     // 父马
    private int birthyear;           // 出生年份

    // 构造方法
    public Thoroughbred(Thoroughbred mother, Thoroughbred father, int birthyear) {
        this.mother = mother;
        this.father = father;
        this.birthyear = birthyear;
    }

    // 获取当前年龄
    public int getCurrentAge() {
        int currentYear = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR);
        return currentYear - birthyear;
    }

    // 获取父马
    public Thoroughbred getFather() {
        return father;
    }

    // 获取母马
    public Thoroughbred getMother() {
        return mother;
    }
}
